<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%
    request.setCharacterEncoding("UTF-8");
    String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : "";
%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<%
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
    String date = format.format(new Date());
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/StudentsListPageAsEnrol.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/CartimeListPage.jsp" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <script type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=path%>/CSS/backLayout.css">
    <link rel="stylesheet" type="text/css" href="<%=path%>/CSS/bombBox.css">

</head>
<style>
    select {
        width: 234px;
        height: 31px
    }

    .tr td {
        font-size: 14px;
        color: #ffffff
    }

    .tr_td {
        height: 40px;
    }

    .tr_td td {
        border-bottom: 1px solid #ededed;
        text-align: center;
    }

    tr td:nth-child(1) {
        font-size: 14px;
        color: #cccccc
    }

    .date {
        border: 0;
        background: #ffffff;
        text-align: center;
    }

    .tr_td td:nth-child(1) {
        border-left: 1px solid #cccccc;
    }

    .tr_td td:nth-child(3) {
        border-right: 1px solid #cccccc;
    }

    .addTable.deleteTable:HOVER {
        cursor: pointer;
    }

    type[type='checkbox'] {
        width: 15px
    }

    .input_hang {
        width: 480px;
        height: 60px;
    }

    .input_hang input {
        width: 183px;
        height: 28px;
        line-height: 28px;
        border: solid 1px #cccccc;
    }

    .input_hang .gn_name {
        line-height: 30px;
        height: 30px;
    }

    .right_hang {
        padding-top: 130px;
        padding-left: 170px;
        width: 800px;
        height: 60px;
    }

    .input_hang select {
        width: 185px;
    }

</style>
<body style="background: #f5f5f5">
<div class="main">
    <div id="modal-overlay">

    </div>
    <div class="weizhi">
        预约管理>>练车预约（批量）>>新增
    </div>
    <%--提示的隐藏标识--%>
    <input type="hidden" id="alertType" value="${alertType}">
    <div class="div_body">
        <form action="<%=path%>/DrivingSys/practiseOrderAdd" method="post">
            <div class="div_form" style="min-height: 250px">

                <div class="input_hang">
                    <div class="input_hang">
                        <span class="gn_name">预约练车时间&nbsp;:&nbsp;</span>
                        <input name="cfdycs" class="is_click" value="" style="color: gray;"
                               onclick="clicklcsj($(this))"/>
                        <input type="hidden" name="cflcsjid" value="" style="color: gray;"/>
                        <input type="hidden" name="cfqty" value="" style="color: gray;"/>
                    </div>
                    <div class="input_hang">
                        <span class="gn_name">预约类型&nbsp;:&nbsp;</span>
                        <select style="width: 185px;height: 32px" class="cfbilltype" name="cfbilltype">
                            <option value="2" style="font-size: 16px">科目二</option>
                            <option value="3" style="font-size: 16px">科目三</option>
                        </select>
                    </div>
                    <div class="input_hang">
                        <span class="gn_name">车型&nbsp;:&nbsp;</span>
                        <select class="carType" name="cfsqzjcxdh">
                            <option style="color: gray;" value="A1">A1</option>
                            <option style="color: gray;" value="A2">A2</option>
                            <option style="color: gray;" value="A3">A3</option>
                            <option style="color: gray;" value="B1">B1</option>
                            <option style="color: gray;" value="B2">B2</option>
                            <option selected="selected" style="color: gray;" value="C1">C1</option>
                            <option style="color: gray;" value="C2">C2</option>
                            <option style="color: gray;" value="C3">C3</option>
                            <option style="color: gray;" value="C4">C4</option>
                            <option style="color: gray;" value="D">D</option>
                            <option style="color: gray;" value="E">E</option>
                            <option style="color: gray;" value="F">F</option>
                            <option style="color: gray;" value="M">M</option>
                            <option style="color: gray;" value="N">N</option>
                            <option style="color: gray;" value="P">P</option>
                        </select>
                    </div>
                </div>

            </div>
            <div class="div_tj" style="margin-bottom: 200px; margin-top: 0px;">
                <div>
                    <input id="submit" class="input_submit qd" value="" type="submit" style="margin-top: 0px;">
                </div>
            </div>

        </form>
    </div>
</div>
</body>
<script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
<%@ include file="/WEB-INF/JSP/ajax.jsp" %>
<script type="text/javascript" src="<%=path%>/HoganJS/handlebars-v4.0.11.js"></script>


<script type="text/javascript">

    //弹出练车时间的信息框
    function clicklcsj(e) {
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data3').css('visibility', 'visible')
        $('.data3-checkbox:checkbox').removeAttr('checked');
        $('.page').show();
        index = 1
        $('#cartimeList').html("<div class='loading'></div>");
        $.ajax({
            url: '<%=path5%>/DrivingSys/getExerciseCarPlan ',
            type: "post",
            data: {
                'pindex': '0',
                'name': cartimeName.val(),
            },
            dataType: "json",
            success: function (res) {
                $('#cartimeList').html(myTemplatcartime(res));
                $('#totalPage3').val(res.pb3);
            },
            error: function () {
                alert('Error');
            }
        });
        _this = e;
    }

    /* 关闭弹出框    */
    $('.btn').click(function () {
        $('#modal-overlay').css('visibility', 'hidden')
        $('.modal-data3').css('visibility', 'hidden')
        $('.data3-checkbox:checkbox').removeAttr('checked');
        $('.page').hide();
    })
  $('form').submit(function () {
      var cartype=$('.carType').val();
      var carTime=$('.is_click').val();
      if(carTime.indexOf(cartype) >=0){
          return true;
      }
      alert("您选择的车型与练车时间不符")
      return false;
  })

</script>
</html>